﻿$(function() {
    $("#DIALOG").dialog({
        autoOpen: false,
        bgiframe: true,
		width:761,
		height: 620,
        modal: true,
		show:'slide'
    });
});

/*好友邀请*/
function showFriendRequestDialog(userid,username,avatar) 
{
    var iframe = $('#DIALOG iframe').get(0);
    var src = "/pages/alpha/floatpage/friendinvited.htm?fid="+userid+"&fname="+username.escUrl()+"&favatar="+avatar;
    if (iframe.src.toLowerCase().indexOf(src) <0) {
        iframe.src = src;
    }
	setDialogParam(iframe, 450, 250, $('#DIALOG'), 500,300, '好友邀请');
	$('#DIALOG').dialog('open');
}

/*打个招呼*/
function showActionSendingDialog(userid) 
{
    var iframe = $('#DIALOG iframe').get(0);
    var src = "/pages/alpha/floatpage/hudongsend.htm?toid="+userid;
    if (iframe.src.toLowerCase().indexOf(src) <0) {
        iframe.src = src;
    }
	setDialogParam(iframe, 450, 250, $('#DIALOG'), 500,300, '打个招呼');
	$('#DIALOG').dialog('open');
}

/*短消息*/
function showMsgSendingDialog(userid) 
{
    var iframe = $('#DIALOG iframe').get(0);
    var src = "/pages/alpha/floatpage/duanxinsend.htm?toid="+userid;
    if (iframe.src.toLowerCase().indexOf(src) <0) {
        iframe.src = src;
    }
	setDialogParam(iframe, 450, 250, $('#DIALOG'), 500,300, '发短消息');
	$('#DIALOG').dialog('open');
}

/*分享日志*/
function showShareLogDialog(lid) 
{
    var iframe = $('#DIALOG iframe').get(0);
    var src = "/pages/alpha/floatpage/sharelog.htm?lid="+lid;
    if (iframe.src.toLowerCase().indexOf(src) <0) {
        iframe.src = src;
    }
	setDialogParam(iframe, 450, 250, $('#DIALOG'), 500,300, '分享日志');
	$('#DIALOG').dialog('open');
}
/*分享帖子*/
function showShareBBSTopicDialog(id)
{
    var iframe = $('#DIALOG iframe').get(0);
    var src = "/pages/alpha/floatpage/sharetopic.htm?tid="+id;
    if (iframe.src.toLowerCase().indexOf(src) <0) {
        iframe.src = src;
    }
	setDialogParam(iframe, 450, 250, $('#DIALOG'), 500,300, '分享帖子');
	$('#DIALOG').dialog('open');
}
/*分享用户*/
function showShareUserDialog(id)
{
    var iframe = $('#DIALOG iframe').get(0);
    var src = "/pages/alpha/floatpage/shareuser.htm?uid="+id;
    if (iframe.src.toLowerCase().indexOf(src) <0) {
        iframe.src = src;
    }
	setDialogParam(iframe, 450, 250, $('#DIALOG'), 500,300, '分享用户');
	$('#DIALOG').dialog('open');
}